import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/user_info_gametype_entity.dart';

UserInfoGametypeEntity $UserInfoGametypeEntityFromJson(
    Map<String, dynamic> json) {
  final UserInfoGametypeEntity userInfoGametypeEntity = UserInfoGametypeEntity();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    userInfoGametypeEntity.userId = userId;
  }
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    userInfoGametypeEntity.nickName = nickName;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    userInfoGametypeEntity.avatar = avatar;
  }
  final double? userBalance = jsonConvert.convert<double>(json['userBalance']);
  if (userBalance != null) {
    userInfoGametypeEntity.userBalance = userBalance;
  }
  final String? walletAddress = jsonConvert.convert<String>(
      json['walletAddress']);
  if (walletAddress != null) {
    userInfoGametypeEntity.walletAddress = walletAddress;
  }
  final String? guildName = jsonConvert.convert<String>(json['guildName']);
  if (guildName != null) {
    userInfoGametypeEntity.guildName = guildName;
  }
  final String? guildId = jsonConvert.convert<String>(json['guildId']);
  if (guildId != null) {
    userInfoGametypeEntity.guildId = guildId;
  }
  final int? guildMemberLevel = jsonConvert.convert<int>(
      json['guildMemberLevel']);
  if (guildMemberLevel != null) {
    userInfoGametypeEntity.guildMemberLevel = guildMemberLevel;
  }
  final String? email = jsonConvert.convert<String>(json['email']);
  if (email != null) {
    userInfoGametypeEntity.email = email;
  }
  final UserInfoGametypeWithdrawSet? withdrawSet = jsonConvert.convert<
      UserInfoGametypeWithdrawSet>(json['withdrawSet']);
  if (withdrawSet != null) {
    userInfoGametypeEntity.withdrawSet = withdrawSet;
  }
  final int? stoneNum = jsonConvert.convert<int>(json['stoneNum']);
  if (stoneNum != null) {
    userInfoGametypeEntity.stoneNum = stoneNum;
  }
  final double? rechargeMinDrn = jsonConvert.convert<double>(
      json['rechargeMinDrn']);
  if (rechargeMinDrn != null) {
    userInfoGametypeEntity.rechargeMinDrn = rechargeMinDrn;
  }
  final int? rechargeMinCoin = jsonConvert.convert<int>(
      json['rechargeMinCoin']);
  if (rechargeMinCoin != null) {
    userInfoGametypeEntity.rechargeMinCoin = rechargeMinCoin;
  }
  final int? rechargeUsdtCoin = jsonConvert.convert<int>(
      json['rechargeUsdtCoin']);
  if (rechargeUsdtCoin != null) {
    userInfoGametypeEntity.rechargeUsdtCoin = rechargeUsdtCoin;
  }
  final int? coin = jsonConvert.convert<int>(json['coin']);
  if (coin != null) {
    userInfoGametypeEntity.coin = coin;
  }
  final int? newGift = jsonConvert.convert<int>(json['newGift']);
  if (newGift != null) {
    userInfoGametypeEntity.newGift = newGift;
  }
  return userInfoGametypeEntity;
}

Map<String, dynamic> $UserInfoGametypeEntityToJson(
    UserInfoGametypeEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['nickName'] = entity.nickName;
  data['avatar'] = entity.avatar;
  data['userBalance'] = entity.userBalance;
  data['walletAddress'] = entity.walletAddress;
  data['guildName'] = entity.guildName;
  data['guildId'] = entity.guildId;
  data['guildMemberLevel'] = entity.guildMemberLevel;
  data['email'] = entity.email;
  data['withdrawSet'] = entity.withdrawSet?.toJson();
  data['stoneNum'] = entity.stoneNum;
  data['rechargeMinDrn'] = entity.rechargeMinDrn;
  data['rechargeMinCoin'] = entity.rechargeMinCoin;
  data['rechargeUsdtCoin'] = entity.rechargeUsdtCoin;
  data['coin'] = entity.coin;
  data['newGift'] = entity.newGift;
  return data;
}

extension UserInfoGametypeEntityExt on UserInfoGametypeEntity {
  UserInfoGametypeEntity copyWith({
    String? userId,
    String? nickName,
    String? avatar,
    double? userBalance,
    String? walletAddress,
    String? guildName,
    String? guildId,
    int? guildMemberLevel,
    String? email,
    UserInfoGametypeWithdrawSet? withdrawSet,
    int? stoneNum,
    double? rechargeMinDrn,
    int? rechargeMinCoin,
    int? rechargeUsdtCoin,
    int? coin,
    int? newGift,
  }) {
    return UserInfoGametypeEntity()
      ..userId = userId ?? this.userId
      ..nickName = nickName ?? this.nickName
      ..avatar = avatar ?? this.avatar
      ..userBalance = userBalance ?? this.userBalance
      ..walletAddress = walletAddress ?? this.walletAddress
      ..guildName = guildName ?? this.guildName
      ..guildId = guildId ?? this.guildId
      ..guildMemberLevel = guildMemberLevel ?? this.guildMemberLevel
      ..email = email ?? this.email
      ..withdrawSet = withdrawSet ?? this.withdrawSet
      ..stoneNum = stoneNum ?? this.stoneNum
      ..rechargeMinDrn = rechargeMinDrn ?? this.rechargeMinDrn
      ..rechargeMinCoin = rechargeMinCoin ?? this.rechargeMinCoin
      ..rechargeUsdtCoin = rechargeUsdtCoin ?? this.rechargeUsdtCoin
      ..coin = coin ?? this.coin
      ..newGift = newGift ?? this.newGift;
  }
}

UserInfoGametypeWithdrawSet $UserInfoGametypeWithdrawSetFromJson(
    Map<String, dynamic> json) {
  final UserInfoGametypeWithdrawSet userInfoGametypeWithdrawSet = UserInfoGametypeWithdrawSet();
  final int? dayMaxCount = jsonConvert.convert<int>(json['dayMaxCount']);
  if (dayMaxCount != null) {
    userInfoGametypeWithdrawSet.dayMaxCount = dayMaxCount;
  }
  final double? minDrn = jsonConvert.convert<double>(json['minDrn']);
  if (minDrn != null) {
    userInfoGametypeWithdrawSet.minDrn = minDrn;
  }
  final int? maxDrn = jsonConvert.convert<int>(json['maxDrn']);
  if (maxDrn != null) {
    userInfoGametypeWithdrawSet.maxDrn = maxDrn;
  }
  final double? feeRate = jsonConvert.convert<double>(json['feeRate']);
  if (feeRate != null) {
    userInfoGametypeWithdrawSet.feeRate = feeRate;
  }
  final int? everyDoranCoin = jsonConvert.convert<int>(json['everyDoranCoin']);
  if (everyDoranCoin != null) {
    userInfoGametypeWithdrawSet.everyDoranCoin = everyDoranCoin;
  }
  final int? withdrawMinCoin = jsonConvert.convert<int>(
      json['withdrawMinCoin']);
  if (withdrawMinCoin != null) {
    userInfoGametypeWithdrawSet.withdrawMinCoin = withdrawMinCoin;
  }
  return userInfoGametypeWithdrawSet;
}

Map<String, dynamic> $UserInfoGametypeWithdrawSetToJson(
    UserInfoGametypeWithdrawSet entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['dayMaxCount'] = entity.dayMaxCount;
  data['minDrn'] = entity.minDrn;
  data['maxDrn'] = entity.maxDrn;
  data['feeRate'] = entity.feeRate;
  data['everyDoranCoin'] = entity.everyDoranCoin;
  data['withdrawMinCoin'] = entity.withdrawMinCoin;
  return data;
}

extension UserInfoGametypeWithdrawSetExt on UserInfoGametypeWithdrawSet {
  UserInfoGametypeWithdrawSet copyWith({
    int? dayMaxCount,
    double? minDrn,
    int? maxDrn,
    double? feeRate,
    int? everyDoranCoin,
    int? withdrawMinCoin,
  }) {
    return UserInfoGametypeWithdrawSet()
      ..dayMaxCount = dayMaxCount ?? this.dayMaxCount
      ..minDrn = minDrn ?? this.minDrn
      ..maxDrn = maxDrn ?? this.maxDrn
      ..feeRate = feeRate ?? this.feeRate
      ..everyDoranCoin = everyDoranCoin ?? this.everyDoranCoin
      ..withdrawMinCoin = withdrawMinCoin ?? this.withdrawMinCoin;
  }
}